widget: Don't notify :parent when rearranging widgets
authorTimm Bäder <mail@baedert.org>
Sun, 29 Oct 2017 16:27:53 +0000 (17:27 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 29 Oct 2017 16:27:53 +0000 (17:27 +0100)
gtk_widget_reposition_after is also valid to call if the widget already
has a parent, so don't notify the parent property in that case.

gtk/gtkwidget.c

index ebf5dbf147d3bf99c4f7d32823b9f8661b5f0185..d60390665cf5b01c21b8f728b025350c72da6227 100644 (file)
@@ -8360,7 +8360,9 @@ gtk_widget_reposition_after (GtkWidget *widget,
 
   if (priv->parent->priv->anchored && prev_parent == NULL)
     _gtk_widget_propagate_hierarchy_changed (widget, NULL);
-  g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
+
+  if (prev_parent == NULL)
+    g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
 
   /* Enforce realized/mapped invariants
    */